<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<sx:head/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
djConfig = {
    scopeMap: [
        ["dojo", "coolio"],
        ["dijit", "cooliow"],
        ["dojox", "cooliox"],
    ],
    modulePaths: {
        "coolio.actions": "../coolio/actions"
    },
    bindEncoding: "UTF-8",
    parseOnLoad : true,
    _hasResource: [],
    searchIds: []
};
</script>
<script type="text/javascript" src="<%=basePath%>javascript/dojo/dojo/dojo.js"></script>
<script type="text/javascript" src="<%=basePath%>javascript/dojo/dojox/timing/_base.js"></script>
<script type="text/javascript" src="<%=basePath%>javascript/status_reply.js"></script>
<script type="text/javascript">
dojo.addOnLoad(function() {
		dojo.event.topic.subscribe('commentStatus', this,
				function(data, type, e) {
					if (type == 'load') {
						addComment(data);
					} else if (type == 'error') {
						alert('Cannot comment the status!');
					}
				});
});

function addComment(data){
	oComment=eval('(' + data + ')');
	add_comment('','<%=basePath%>',oComment.comment.userId,oComment.comment.userName,oComment.comment.content,oComment.comment.id,oComment.comment.updateTime);
}
</script>
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="../stylesheet/layout.css" />
<script type="text/javascript" src="<%=basePath%>javascript/footer_script.js"></script>
<script>
var request_count=-1;
var notification_count=-1;
var t = new cooliox.timing.Timer();
t.setInterval(3000);
t.onTick = function() {
	get_update('<%=basePath%>');
};
t.start();
get_update('<%=basePath%>');
</script>
</head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include>
<jsp:include page="../common/navigator.jsp"></jsp:include>
<div id="main">
<s:property value="notice" />
<table width="100%">
<tr>
	<td><a href="<s:url action="get_user" namespace="/user"><s:param name="userId"><s:property value="status.userId"/></s:param></s:url>"><s:property value="status.userName" /></a></td>
	<td colspan="2"><s:property value="status.content"/></td>
	<td><s:property value="status.updateTime"/></td>
	</tr>
	<tbody id="commentList">
	<s:iterator value="status.comments">
	<tr>
	<td>&nbsp;</td>
	<td><a href="<s:url action="get_user" namespace="/user"><s:param name="userId"><s:property value="userId"/></s:param></s:url>"><s:property value="userName" /></a>:<s:property  value="content"/></td>
	<td><input type="button" value="reply" onclick="reply('replyTextField','<s:property value="id"/>','<s:property value="userName"/>');"/></td>
	<td><s:property value="updateTime"/></td>
	</tr>
	</s:iterator>
	</tbody>
	<s:form id="replyForm" action="reply_status" namespace="/status" theme="simple">
		<input name="statusId" type="hidden" value="<s:property value="status.id"/>"/>
		<input id="parentId" type="hidden" name="parentId" />
		<tr>
			<td>&nbsp;</td>
			<td><s:textfield id="replyTextField" theme="simple" name="commentContent" size="50%"/></td>
			<td><sx:submit formId="replyForm" notifyTopics="commentStatus"/></td>
		</tr>
	</s:form>
</table>
</div>
<jsp:include page="../common/footer.jsp"></jsp:include>
</body>
</html>